import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
import 'element-plus/dist/index.css'
import piniapluginpersistedstate from 'pinia-plugin-persistedstate'
const app = createApp(App)
import piniaPersist from 'pinia-plugin-persistedstate';
const pinia = createPinia();


// 数据访问
import axios from 'axios'
// 添加JWT token信息
axios.defaults.headers.common["Authorization"] = "Bearer " + window.localStorage.getItem("token");

pinia.use(piniaPersist); // 使用持久化插件
app.use(createPinia().use(piniapluginpersistedstate))
app.use(router)
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

app.use(ElementPlus, {
    locale: zhCn,
})

// app.use(pinia)

app.mount('#app')
